<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
            <tr>
                <th class="text-center"><div class="table-first-id">ID</div></th>
                <th class="text-center" width="11%">帐号名</th>
                <th class="text-center" width="10%">真实姓名</th>
                <th class="text-center" width="15%">部门</th>
                <th class="text-center" width="10%">角色</th>
                <th class="text-center" width="6%">用户状态</th>
                <th class="text-center" width="6%">申请状态</th>
                <th class="text-center" width="8%">注册时间</th>
                <th class="text-center" width="8%">结束时间</th>
                <th class="text-center" width="10%">创建人</th>
                <th class="text-center" width="12%">操作</th>
            </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody>
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                    <th class="text-center" width="11%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="15%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="6%">&nbsp;</th>
                    <th class="text-center" width="6%">&nbsp;</th>
                    <th class="text-center" width="8%">&nbsp;</th>
                    <th class="text-center" width="8%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="12%">&nbsp;</th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="10" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="sysUser : ${dataMap['list']}" th:attr="data-id=${sysUser['id']}" th:attrappend="data-status=${sysUser['status']}" th:attrprepend="id='sys-user-'+${sysUser['id']}">
                    <td class="text-center">
                        <div class="table-first-id">
                            <input type="checkbox" th:value="${sysUser['id']}" class="i-checks"/>
                        </div>
                    </td>
                    <td class="text-center" th:text="${sysUser['username']}"></td>
                    <td class="text-center"><span class="pie" th:text="${sysUser['ralName']}"></span></td>
                    <td class="text-center">
                        <span th:if="${sysUser['sysGroup']}==null">—</span>
                        <span th:if="${sysUser['sysGroup']}!=null" th:text="${sysUser['sysGroup']['groupName']}"></span>
                    </td>
                    <td class="text-center">
                        <span th:if="${#lists.isEmpty(sysUser['sysRoleList'])}">—</span>
                        <span th:if="!${#lists.isEmpty(sysUser['sysRoleList'])}" th:each="sysRole,index : ${sysUser['sysRoleList']}">
                            <span th:text="${sysRole['roleName']}"></span>
                            <br th:if="${index.index} <= ${#lists.size(sysUser['sysRoleList'])}-1"/>
                        </span>
                    </td>
                    <td class="text-center" th:attr="id='status-'+${sysUser['id']}">
                        <span th:if="${sysUser['status']}==0">—</span>
                        <span th:if="${sysUser['status']}==1" class="label label-info">正常</span>
                        <span th:if="${sysUser['status']}==2" class="label label-danger">禁用</span>
                    </td>
                    <td class="text-center" th:attr="id='approve-'+${sysUser['id']}">
                        <span th:if="${sysUser['userType']}==2 and ${sysUser['status']}==0" class="label label-danger">未批准</span>
                        <span th:if="${sysUser['userType']}==2 and ${sysUser['status']}==1" class="label label-info">已批准</span>
                        <span th:if="${sysUser['userType']}==1 or ${sysUser['status']}==2 ">—</span>
                    </td>
                    <td class="text-center">
                        <span th:if="${sysUser['createTime']}==null">—</span>
                        <span th:text="${#strings.substring(sysUser['createTime'],0,10)}"></span>
                    </td>
                    <td class="text-center">
                        <span th:if="${sysUser['userType']}==1 or ${sysUser['endTime']} ==null">—</span>
                        <span th:attr="id='end-time-'+${sysUser['id']}" th:if="${sysUser['userType']}==2 and ${sysUser['endTime']}!=null" th:text="${#strings.substring(sysUser['endTime'],0,10)}"></span>
                    </td>
                    <td class="text-center">
                        <span th:if="${#maps.isEmpty(sysUser['sysCreateUser'])}">—</span>
                        <span th:if="!${#maps.isEmpty(sysUser['sysCreateUser'])}" th:text="${sysUser['sysCreateUser']['username']}"></span>
                    </td>
                    <td class="text-center" data-icon>
                        <a th:attr="data-id=${sysUser['id']}" href="javascript:void(0)" class="c-master fs14" data-toggle="tooltip" data-placement="bottom" data-original-title="查看"><i class="fa fa-eye"></i></a>
                        <a th:attr="data-id=${sysUser['id']}" th:href="@{/admin/manage/user/initUpdate?userId={userId}(userId=${sysUser['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="修改"><i class="fa fa-edit"></i></a>
                        <a th:if="${sysUser['userType']}==2 and ${sysUser['status']}==0" th:attr="data-id=${sysUser['id']}" href="javascript:void(0)" class="c-master fs14 ml5" th:attrprepend="id='status-action-'+${sysUser['id']},data-user-type=${sysUser['userType']}" data-toggle="tooltip" data-placement="bottom" data-original-title="批准申请"><i class="fa fa-check"></i></a>
                        <a th:if="${sysUser['status']}==1" th:attr="data-id=${sysUser['id']}" href="javascript:void(0)" class="c-master fs14 ml5" th:attrprepend="id='status-action-'+${sysUser['id']},data-user-type=${sysUser['userType']}" data-toggle="tooltip" data-placement="bottom" data-original-title="禁用"><i class="fa fa-unlock-alt"></i></a>
                        <a th:if="${sysUser['status']}==2" th:attr="data-id=${sysUser['id']}" href="javascript:void(0)" class="c-master fs14 ml5" th:attrprepend="id='status-action-'+${sysUser['id']},data-user-type=${sysUser['userType']}" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复"><i class="fa fa-history"></i></a>
                        <a th:if="${sysUser['userType']}==2 and ${sysUser['endTime']}!=null and ${sysUser['endTime'] < #dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd HH:mm:ss') }" th:attr="data-id=${sysUser['id']}" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="延期"><i class="fa fa-clock-o"></i></a>
                        <a th:attr="data-id=${sysUser['id']}" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="修改密码"><i class="fa fa-key"></i></a>
                        <a th:attr="data-id=${sysUser['id']}" id="individual-authorization" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="单独授权限"><i class="fa fa-cogs"></i></a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>
</html>